﻿namespace KinonekoSoftware.Studio.Resources.Converters
{
    public class CustomizationTemplateSelector : DataTemplateSelector
    {
        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            if (item is CustomizedInformation ci)
            {
                return ci.Type switch
                {
                    CustomizedInformationType.Numeric => Numeric,
                    CustomizedInformationType.Toggle => Toggle,
                    _ => Text,
                };
            }
            return base.SelectTemplate(item, container);
        }
        
        public DataTemplate Text { get; set; }
        public DataTemplate Numeric { get; set; }
        public DataTemplate Toggle { get; set; }
    }
}